﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sparkle.Hosting;

namespace Sparkle.Demo.Model
{
    public class Address: IModel
    {
        public long AddressId { get; set; }

        public string  Address1 { get; set; }
        public string  Address2 { get; set; }
        public string  Address3 { get; set; }

        public string  Town { get; set; }

        public string  Region { get; set; }

        private CountryLookup _country =new CountryLookup();

        public CountryLookup Country 
        {
            get { return _country; }
            set { _country =value; }
        }

        public override string ToString()
        {
            return  this.AddressId == 0 ? "Unknown Address" :
                string.Format("{0},{1},{2},{3} {4}", this.Address1,this.Address2,this.Address3,this.Town ,this.Region);
        }


        #region IModel Members

        public bool Validate()
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
